import request from '@/utils/request'

// 查询商品记录列表
export function listGoodsExchange(query) {
  return request({
    url: '/business/goodsExchange/list',
    method: 'get',
    params: query
  })
}

// 查询商品记录详细
export function getGoodsExchange(userGoodsId) {
  return request({
    url: '/business/goodsExchange/' + userGoodsId,
    method: 'get'
  })
}

// 新增商品记录
export function addGoodsExchange(data) {
  return request({
    url: '/business/goodsExchange',
    method: 'post',
    data: data
  })
}

// 修改商品记录
export function updateGoodsExchange(data) {
  return request({
    url: '/business/goodsExchange',
    method: 'put',
    data: data
  })
}

// 删除商品记录
export function delGoodsExchange(userGoodsId) {
  return request({
    url: '/business/goodsExchange/' + userGoodsId,
    method: 'delete'
  })
}

export function cancelUserExchange(userGoodsId) {
    return request({
        url: '/business/goodsExchange/cancelExchange/' + userGoodsId,
        method: 'delete'
    })
}
